b2ff3492eb6527127d2f3cda479bfdb905b951fc,swc-dumpreader/src/main/java/org/sweble/wikitext/dumpreader/model/DumpConverter.java,DumpConverter,convertToRevision_0_5,#Object#,88
Before Change
Contributor contributor_ = null;
if (contributor != null)
{
contributor_ = new Contributor(
contributor.getId(),
contributor.getIp(),
contributor.getDeleted() == org.sweble.wikitext.dumpreader.export_0_5.DeletedFlagType.DELETED,
contributor.getUsername());
}
Comment comment_ = null;
if (comment != null)
{
comment_ = new Comment(
comment.getDeleted() == org.sweble.wikitext.dumpreader.export_0_5.DeletedFlagType.DELETED,
comment.getValue());
}
Text text_ = null;
if (text != null)
{
BigInteger textIdBi = null;
String textId = text.getId();
if (textId != null)
textIdBi = new BigInteger(textId);
text_ = new Text(
textIdBi,
text.getBytes(),
text.getDeleted() == org.sweble.wikitext.dumpreader.export_0_5.DeletedFlagType.DELETED,
text.getValue());
}
DateTime revisionTimestampDt = null;
XMLGregorianCalendar revisionTimestamp = revision.getTimestamp();
if (revisionTimestamp != null)
revisionTimestampDt = new DateTime(revisionTimestamp.toGregorianCalendar());
return new Revision(
revision.getId(),
revisionTimestampDt,
revision.getMinor() != null,
contributor_,
comment_,
text_);
}
// =========================================================================
After Change
org.sweble.wikitext.dumpreader.export_0_5.TextType text =
revision.getText();
Contributor contributor_ = null;
String contributorIp = null;
if (contributor != null)
{
if (contributor.getIp() == null)
{
contributor_ = new Contributor(
contributor.getId(),
contributor.getDeleted() == org.sweble.wikitext.dumpreader.export_0_5.DeletedFlagType.DELETED,
contributor.getUsername());
}
else
{
contributorIp = contributor.getIp();
}
}
boolean commentDeleted = false;
String commentText = null;
if (comment != null)
{
commentDeleted =
comment.getDeleted() == org.sweble.wikitext.dumpreader.export_0_5.DeletedFlagType.DELETED;
commentText = comment.getValue();
}
boolean textDeleted = false;
String textText = null;
if (text != null)
{
// We ignore:
// - getBytes
// - getId
// - getSpace
textDeleted =
text.getDeleted() == org.sweble.wikitext.dumpreader.export_0_5.DeletedFlagType.DELETED;
textText = text.getValue();
}
DateTime revisionTimestampDt = null;
XMLGregorianCalendar revisionTimestamp = revision.getTimestamp();
if (revisionTimestamp != null)
revisionTimestampDt = new DateTime(revisionTimestamp.toGregorianCalendar());
return new Revision(
revision.getId(),
new BigInteger("-1"),
revisionTimestampDt,
revision.getMinor() != null,
contributor_,
contributorIp,
commentText,
commentDeleted,
textText,
null,
textDeleted,
null,
null);
}
// =========================================================================